import * as qs from 'querystring';
import { MapType } from '@common/types/interface';

/**
 * 解析GET参数
 * @param search
 */
export function getQueryParameters(search: string) {
  if (search.length && search[0] === '?') {
    search = search.substr(1);
  }
  return <MapType<string>>qs.parse(search);
}
